# models/sys_api_teamwork.py
from sqlalchemy import Column, String, Date, DateTime, Boolean, Integer
from src.core.ormdb import Base
from src.core import str_utils as strU

class SysApiTeamwork(Base):
    __tablename__ = 'sys_api_teamwork'
    __table_args__ = {'comment': 'API项目协同'}

    id = Column(String(36), primary_key=True, default=lambda: strU.generate_id(), comment="唯一标识ID")
    api_id = Column(String(36), nullable=True, comment='API主键')
    user_id = Column(String(36), nullable=True, comment='用户')
    is_admin = Column(Integer, nullable=True, comment='启用，1：管理员，0：普通用户')
    is_activate = Column(Integer, default=1, comment='启用，1：启用，0：停用')
    disable_date = Column(DateTime, nullable=True, comment='停用时间')

    deletion_mark = Column(Integer, default=0, comment='删除标志，0 表示未删除，1 表示已删除')
    deletion_reason = Column(String(255), nullable=True, comment='删除原因')
    deletion_date = Column(DateTime, nullable=True, comment='删除日期')
    deletion_by = Column(String(255), nullable=True, comment='删除者')
    create_date = Column(DateTime, default=lambda: strU.now(), comment='创建日期')
    creator_by = Column(String(255), nullable=True, comment='创建者')
    last_updated_date = Column(DateTime, nullable=True, comment='最后更新时间')
    last_updated_by = Column(String(255), nullable=True, comment='最后更新者')
